set(TARGET_TEST_LINK_LIBS xlcomm_base xlcomm_net)

if(CMAKE_HOST_UNIX)
  set(TARGET_TEST_LINK_LIBS ${TARGET_TEST_LINK_LIBS} pthread)
else()
  # # 打开编译器异常处理功能。解决boost::throw_exception(class std::exception const &)链接失败问题
  # set(CMAKE_CXX_FLAGS "/EHsc ${CMAKE_CXX_FLAGS}")
endif()

set(MY_TEST_BIN
  simple_server
  time_client
  file_transfer_server
  chat_server
  chat_client
)
FOREACH(test ${MY_TEST_BIN})
  add_executable(${test} ${test}.cc)
  target_link_libraries(${test} ${TARGET_TEST_LINK_LIBS})
ENDFOREACH(test)